package chapter02;

import java.util.Scanner;

public class Training03 {
    public static void main(String[] args) {
        int[] arr = getUserInput();
        printIntArray(arr);
        //todo 1.将用户输入的数字中奇数显示出来
        //函数内部编写循环结构进行条件判断
        showOdd(arr);
        //todo 2.将用户输入的数字中偶数显示出来
        //函数内部编写循环结构进行条件判断
        showEven(arr);
    }
    public static void showOdd(int []arr){
    }
    public static void showEven(int []arr){
    }
    public  static  int[] getUserInput(){
        System.out.println("请随机输入五个整数");
        Scanner sc = new Scanner(System.in);
        int[] arr = new int[5];
        for (int i = 0; i < arr.length; i++) {
            System.out.println("请输入数字：");
            arr[i] = sc.nextInt();
        }
        return arr;
    }
    public static void printIntArray(int[] arr){
        System.out.println("你输入的数字是：");
        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i] + " ");
        }
        System.out.println("\n");
    }
}
